package com.gxa.service.baoBiaoService.impl;

import com.gxa.common.R;
import com.gxa.mapper.baobiaomapper.CaiGouBaoBiaoMapper;
import com.gxa.mapper.baobiaomapper.CangCunBaoBiaoMapper;
import com.gxa.service.baoBiaoService.CangCunBaoBiaoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

/**
 * @author 86156
 */
@Service
public class CangCunBaoBiaoServiceImpl implements CangCunBaoBiaoService {

    @Autowired
    private CangCunBaoBiaoMapper cangCunBaoBiaoMapper ;

    @Override
    public R selectShangPinShouFaMingXi(String startTime, String endTime, String cangKuId, String shangPinId) {

        R r=new R();
        HashMap<Object, Object> map = new HashMap<>();
        r.setCode(200);
        r.setMsg("没有查到数据！");

        if (startTime==null||endTime==null){
            r.setCode(500);
            r.setMsg("请先输入查询时间！");
        }else {
            map.put("购货单",cangCunBaoBiaoMapper.selectShangPinShouFaMingXiForGouHuo(startTime, endTime ,  cangKuId, shangPinId));
            map.put("调拨单",cangCunBaoBiaoMapper.selectShangPinShouFaMingXiForDiaoBo(startTime, endTime ,  cangKuId, shangPinId));
            map.put("销货单",cangCunBaoBiaoMapper.selectShangPinShouFaMingXiForXiaoHuoDan(startTime, endTime ,  cangKuId, shangPinId));
                r.setCode(200);
                r.setMsg("商品收发明细表查询成功！");
                r.setData(map);
        }
        return r;
    }
}
